import java.util.Scanner;

public class HihoCoder1051 {

	public static void main(String[] args){
		Scanner in  = new Scanner(System.in);
		int count=in.nextInt();
		while(count>0){
			int N=in.nextInt();
			int M=in.nextInt();
			int[] an = new int[N+2];
			an[0]=0;
			an[an.length-1]=100;
			for(int i=1;i<N+1;i++){
				an[i]=in.nextInt();
			}
			handle(an,N,M);
			count--;
		}
	}

	public static void handle(int[] an,int n, int m) {
		int max=0;
		if(m>=n){
			max=an[an.length-1]-an[0];
		}else{			
			for(int i=(m+1);i<an.length;i++){	
				int	point=an[i]-an[i-m-1];
				max=max>point?max:(point-1);
			}
		}
		System.out.println(max);
	}
}
